{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-5.3.0/css/bootstrap.css' %}">
    <script src="{% static 'plugins/bootstrap-5.3.0/js/bootstrap.js' %}"></script>
    <script src="{% static 'js/jquery-3.6.1.js' %}"></script>
</head>
<body>
<div class="container">
    <h1>修改学生信息</h1>
    <form method="POST" action="/orm/{{ stu.id }}/update/">
        {% csrf_token %}
        <div class="mb-3">
            <label class="form-label">学生姓名</label>
            <input type="text" class="form-control" name="stu_name" value="{{ stu.stu_name }}">
        </div>
        <div class="mb-3">
            <label class="form-label">年龄</label>
            <input type="number" class="form-control" name="age" min="18" value="{{ stu.age }}">
        </div>
        <div class="mb-3">
            <label class="form-label">性别</label>
            {% if stu.gender == '男' %}
                <div class="form-check">
                    <input class="form-check-input" type="radio" name="gender" value="男" id="flexCheckDefault" checked>
                    <label class="form-check-label" for="flexCheckDefault">
                        男
                    </label>
                </div>
                <div class="form-check">
                    <input class="form-check-input" type="radio" name="gender" value="女" id="flexCheckChecked">
                    <label class="form-check-label" for="flexCheckChecked">
                        女
                    </label>
                </div>
            {% elif stu.gender == '女' %}
                <div class="form-check">
                    <input class="form-check-input" type="radio" name="gender" value="男" id="flexCheckDefault">
                    <label class="form-check-label" for="flexCheckDefault">
                        男
                    </label>
                </div>
                <div class="form-check">
                    <input class="form-check-input" type="radio" name="gender" value="女" id="flexCheckChecked" checked>
                    <label class="form-check-label" for="flexCheckChecked">
                        女
                    </label>
                </div>
                </div>
            {% endif %}


        <div class="mb-3">
            <label class="form-label">家庭住址</label>
            <input type="text" class="form-control" name="address" value="{{ stu.address }}">
        </div>
        <div class="mb-3">
            <label class="form-label">Python成绩</label>
            <input type="text" class="form-control" name="python_score" min="0" value="{{ stu.python_score }}">
        </div>

        <button type="submit" class="btn btn-primary">Submit</button>
    </form>
</div>
</body>
</html>